﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;

namespace Akronus.TaskScheduler
{
    /// <summary>
    /// The interface for task.
    /// </summary>
    public interface ITask
    {
        /// <summary>
        /// Gets or sets the application URL.
        /// </summary>
        /// <value>The application URL.</value>
        string ApplicationUrl { get; set; }

        /// <summary>
        /// Gets or sets the name of the task.
        /// </summary>
        /// <value>The name.</value>
        string Name { get; set; }

        /// Gets or sets the status. For available statuses check the <see cref="TaskInfoTypes"/> class.
        /// </summary>
        /// <value>The status.</value>
        string Status { get; set; }

        ITaskLog TaskLog { get; set; }

        ITaskInfoDataService DataService { get; set; }

        /// <summary>
        /// Gets or sets the configuration.
        /// </summary>
        /// <value>The configuration.</value>
        XmlNode Configuration { get; set; }

        /// <summary>
        /// Reads configuration.
        /// </summary>
        void Initialize();

        /// <summary>
        /// Executes the task.
        /// </summary>
        void Execute();
    }
}
